package com.example.produces.service.impl;

import com.example.produces.entity.Ostock;
import com.example.produces.mapper.OstockMapper;
import com.example.produces.service.OstockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class OstockImpl implements OstockService {
    @Autowired
    private OstockMapper ostockMapper;
    @Override
    public List<Ostock> findAll() {
        List<Ostock> ostocks=ostockMapper.findAll();
        return ostocks;
    }

    @Override
    public void add(Ostock ostock) {
      ostockMapper.add(ostock);
    }

    @Override
    public Ostock findOne(String designation) {
        return ostockMapper.findOne(designation);
    }

    @Override
    public void upDate(Ostock ostock) {
         ostockMapper.upDate(ostock);
    }

    @Override
    public void delete(String designation) {
            ostockMapper.delete(designation);
    }
}
